//
//  TimerSelectedView.m
//  PropertyMananger
//
//  Created by bh on 17/2/27.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "TimerSelectedView.h"

@implementation TimerSelectedView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        self.bgView = [[UIView alloc] init];
        [self addSubview:self.bgView];
        [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self).with.offset(0);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/2,50));
        }];
        
        self.monthButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.bgView addSubview:self.monthButton];
        [self.monthButton setImage:IMG(@"ico_statistics_month") forState:UIControlStateNormal];
        //点击选择月份
        // [self.monthButton addTarget:self action:@selector(selectedMonth:) forControlEvents:UIControlEventTouchUpInside];
        
        [self.monthButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self.bgView).with.offset(-25);
            make.centerY.equalTo(self.bgView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(50, 50));
        }];
        
        self.yearLabel = [[UILabel alloc]init];
        [self.bgView addSubview:self.yearLabel];

        self.yearLabel.textAlignment = NSTextAlignmentRight;
        self.yearLabel.textColor = BHColor(102, 102, 102);
        self.yearLabel.font = BHFont(15);
        self.yearLabel.text = @"请选择时间";
        
        [self.yearLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self.monthButton.mas_leading).with.offset(-5);
            make.centerY.equalTo(self.monthButton).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/3, 50));
        }];
        

    }
    return self;
}

@end
